package cn.faster.sys.service;

import cn.faster.sys.entity.SysUser;
import cn.faster.sys.vo.SysUserVO;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author xiaoCoder
 * @since 2021-06-06
 */

public interface SysUserService extends IService<SysUser> {

    /**
     * 修改用户信息;
     * @param userVO
     * @return
     * @throws Exception
     */
    SysUserVO updateById(SysUserVO userVO) throws Exception;

    /**
     * 动态查询用户信息
     *
     * @param sysUser
     * @return
     */
    List<SysUser> getUserList(SysUser sysUser);

    /**
     * 保存用户角色
     * @param entity
     * @return
     */

    SysUserVO saveRole(SysUserVO entity) throws Exception;

    /**
     * 退出
     * @return
     */
    String loginOut();

    /**
     * 文件上传
     * @param file
     * @return
     */
    Map<String, String> upload(MultipartFile file) throws Exception;

    /**
     * 保存用户信息
     * @param userVO
     * @return
     * @throws Exception
     */
    SysUserVO save(SysUserVO userVO) throws Exception;

    /**
     * 分页获取用数据信息
     * @param sysUser
     * @param sysUserPage
     * @return
     */
    IPage<SysUser> getUserListByPage(SysUser sysUser, Page<SysUser> sysUserPage);

    /**
     * 根据id获取用户权限组信息
     * @param id
     * @return
     */
    SysUserVO getUserRole(Integer id);
}
